package fctuc.dei.myTwitter.client;

import fctuc.dei.myTwitter.com.Connection;

public abstract class ServerConnection extends Connection {
	public boolean connecting = false;
	public boolean connected = false;
	public boolean disconnect = false;

	public MyTwitterClient client;

	abstract public void realConnect();

	public ServerConnection(MyTwitterClient c){
		super(c);
		this.client = c;
	}

	synchronized public void connect(){
		if(disconnect)
			return;
		if(!connecting){
			connected = false;
			connecting = true;
			realConnect();
			connecting = false;
		}
	}
	
}
